package com.techwells.learningkites.database;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;

import com.techwells.learningkites.database.CourseCategory;
import com.techwells.learningkites.database.Course;
import com.techwells.learningkites.database.Lesson;
import com.techwells.learningkites.database.LessonVideo;
import com.techwells.learningkites.database.VideoCategory;
import com.techwells.learningkites.database.Video;
import com.techwells.learningkites.database.VideoDetail;
import com.techwells.learningkites.database.Serial;
import com.techwells.learningkites.database.Word;
import com.techwells.learningkites.database.Sentence;
import com.techwells.learningkites.database.Test;
import com.techwells.learningkites.database.FavoriteVideo;
import com.techwells.learningkites.database.FavoriteWord;

import com.techwells.learningkites.database.CourseCategoryDao;
import com.techwells.learningkites.database.CourseDao;
import com.techwells.learningkites.database.LessonDao;
import com.techwells.learningkites.database.LessonVideoDao;
import com.techwells.learningkites.database.VideoCategoryDao;
import com.techwells.learningkites.database.VideoDao;
import com.techwells.learningkites.database.VideoDetailDao;
import com.techwells.learningkites.database.SerialDao;
import com.techwells.learningkites.database.WordDao;
import com.techwells.learningkites.database.SentenceDao;
import com.techwells.learningkites.database.TestDao;
import com.techwells.learningkites.database.FavoriteVideoDao;
import com.techwells.learningkites.database.FavoriteWordDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig courseCategoryDaoConfig;
    private final DaoConfig courseDaoConfig;
    private final DaoConfig lessonDaoConfig;
    private final DaoConfig lessonVideoDaoConfig;
    private final DaoConfig videoCategoryDaoConfig;
    private final DaoConfig videoDaoConfig;
    private final DaoConfig videoDetailDaoConfig;
    private final DaoConfig serialDaoConfig;
    private final DaoConfig wordDaoConfig;
    private final DaoConfig sentenceDaoConfig;
    private final DaoConfig testDaoConfig;
    private final DaoConfig favoriteVideoDaoConfig;
    private final DaoConfig favoriteWordDaoConfig;

    private final CourseCategoryDao courseCategoryDao;
    private final CourseDao courseDao;
    private final LessonDao lessonDao;
    private final LessonVideoDao lessonVideoDao;
    private final VideoCategoryDao videoCategoryDao;
    private final VideoDao videoDao;
    private final VideoDetailDao videoDetailDao;
    private final SerialDao serialDao;
    private final WordDao wordDao;
    private final SentenceDao sentenceDao;
    private final TestDao testDao;
    private final FavoriteVideoDao favoriteVideoDao;
    private final FavoriteWordDao favoriteWordDao;

    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        courseCategoryDaoConfig = daoConfigMap.get(CourseCategoryDao.class).clone();
        courseCategoryDaoConfig.initIdentityScope(type);

        courseDaoConfig = daoConfigMap.get(CourseDao.class).clone();
        courseDaoConfig.initIdentityScope(type);

        lessonDaoConfig = daoConfigMap.get(LessonDao.class).clone();
        lessonDaoConfig.initIdentityScope(type);

        lessonVideoDaoConfig = daoConfigMap.get(LessonVideoDao.class).clone();
        lessonVideoDaoConfig.initIdentityScope(type);

        videoCategoryDaoConfig = daoConfigMap.get(VideoCategoryDao.class).clone();
        videoCategoryDaoConfig.initIdentityScope(type);

        videoDaoConfig = daoConfigMap.get(VideoDao.class).clone();
        videoDaoConfig.initIdentityScope(type);

        videoDetailDaoConfig = daoConfigMap.get(VideoDetailDao.class).clone();
        videoDetailDaoConfig.initIdentityScope(type);

        serialDaoConfig = daoConfigMap.get(SerialDao.class).clone();
        serialDaoConfig.initIdentityScope(type);

        wordDaoConfig = daoConfigMap.get(WordDao.class).clone();
        wordDaoConfig.initIdentityScope(type);

        sentenceDaoConfig = daoConfigMap.get(SentenceDao.class).clone();
        sentenceDaoConfig.initIdentityScope(type);

        testDaoConfig = daoConfigMap.get(TestDao.class).clone();
        testDaoConfig.initIdentityScope(type);

        favoriteVideoDaoConfig = daoConfigMap.get(FavoriteVideoDao.class).clone();
        favoriteVideoDaoConfig.initIdentityScope(type);

        favoriteWordDaoConfig = daoConfigMap.get(FavoriteWordDao.class).clone();
        favoriteWordDaoConfig.initIdentityScope(type);

        courseCategoryDao = new CourseCategoryDao(courseCategoryDaoConfig, this);
        courseDao = new CourseDao(courseDaoConfig, this);
        lessonDao = new LessonDao(lessonDaoConfig, this);
        lessonVideoDao = new LessonVideoDao(lessonVideoDaoConfig, this);
        videoCategoryDao = new VideoCategoryDao(videoCategoryDaoConfig, this);
        videoDao = new VideoDao(videoDaoConfig, this);
        videoDetailDao = new VideoDetailDao(videoDetailDaoConfig, this);
        serialDao = new SerialDao(serialDaoConfig, this);
        wordDao = new WordDao(wordDaoConfig, this);
        sentenceDao = new SentenceDao(sentenceDaoConfig, this);
        testDao = new TestDao(testDaoConfig, this);
        favoriteVideoDao = new FavoriteVideoDao(favoriteVideoDaoConfig, this);
        favoriteWordDao = new FavoriteWordDao(favoriteWordDaoConfig, this);

        registerDao(CourseCategory.class, courseCategoryDao);
        registerDao(Course.class, courseDao);
        registerDao(Lesson.class, lessonDao);
        registerDao(LessonVideo.class, lessonVideoDao);
        registerDao(VideoCategory.class, videoCategoryDao);
        registerDao(Video.class, videoDao);
        registerDao(VideoDetail.class, videoDetailDao);
        registerDao(Serial.class, serialDao);
        registerDao(Word.class, wordDao);
        registerDao(Sentence.class, sentenceDao);
        registerDao(Test.class, testDao);
        registerDao(FavoriteVideo.class, favoriteVideoDao);
        registerDao(FavoriteWord.class, favoriteWordDao);
    }
    
    public void clear() {
        courseCategoryDaoConfig.getIdentityScope().clear();
        courseDaoConfig.getIdentityScope().clear();
        lessonDaoConfig.getIdentityScope().clear();
        lessonVideoDaoConfig.getIdentityScope().clear();
        videoCategoryDaoConfig.getIdentityScope().clear();
        videoDaoConfig.getIdentityScope().clear();
        videoDetailDaoConfig.getIdentityScope().clear();
        serialDaoConfig.getIdentityScope().clear();
        wordDaoConfig.getIdentityScope().clear();
        sentenceDaoConfig.getIdentityScope().clear();
        testDaoConfig.getIdentityScope().clear();
        favoriteVideoDaoConfig.getIdentityScope().clear();
        favoriteWordDaoConfig.getIdentityScope().clear();
    }

    public CourseCategoryDao getCourseCategoryDao() {
        return courseCategoryDao;
    }

    public CourseDao getCourseDao() {
        return courseDao;
    }

    public LessonDao getLessonDao() {
        return lessonDao;
    }

    public LessonVideoDao getLessonVideoDao() {
        return lessonVideoDao;
    }

    public VideoCategoryDao getVideoCategoryDao() {
        return videoCategoryDao;
    }

    public VideoDao getVideoDao() {
        return videoDao;
    }

    public VideoDetailDao getVideoDetailDao() {
        return videoDetailDao;
    }

    public SerialDao getSerialDao() {
        return serialDao;
    }

    public WordDao getWordDao() {
        return wordDao;
    }

    public SentenceDao getSentenceDao() {
        return sentenceDao;
    }

    public TestDao getTestDao() {
        return testDao;
    }

    public FavoriteVideoDao getFavoriteVideoDao() {
        return favoriteVideoDao;
    }

    public FavoriteWordDao getFavoriteWordDao() {
        return favoriteWordDao;
    }

}
